//
//  ViewController.m
//  suspendButton
//
//  Created by wanglei on 17/1/5.
//  Copyright © 2017年 wanglei. All rights reserved.
//

#import "ViewController.h"
#import "NSObject+ZYSuspensionView.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.backgroundColor = [UIColor yellowColor];
    self.view.frame = [UIScreen mainScreen].bounds;
    
    [self suspensionViewExample];
}


- (void)suspensionViewExample
{
    // 仅仅创建一个悬浮球，自行实现点击的代理方法
    
    UIColor *color = [UIColor colorWithRed:0.50f green:0.89f blue:0.31f alpha:1.00f];
    
    ZYSuspensionView *sus2 = [[ZYSuspensionView alloc] initWithFrame:CGRectMake(- 50.0 / 6, 200, 50, 50)
                                                               color:color
                                                delegate:self];
    sus2.leanType = ZYSuspensionViewLeanTypeEachSide;
    [sus2 setTitle:@"测试2" forState:UIControlStateNormal];
    [sus2 show];
}


#pragma mark - ZYSuspensionViewDelegate
- (void)suspensionViewClick:(ZYSuspensionView *)suspensionView
{
    NSLog(@"click %@",suspensionView.titleLabel.text);
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
